#include "activity_struct_csv.hpp"
#include "type_conversion.hpp"

//#include <boost/lexical_cast.hpp>

//using boost::lexical_cast;
//using boost::bad_lexical_cast;

activity_struct_csv::activity_struct_csv(std::vector<std::string> const& v)
{
		
	   switch(v.size()-1)
 	   {
		case PROJECT_ID: 
			set_project_id(type_conversion<int>::to_number(v[PROJECT_ID]));
		case LIMITING_ALLOWANCE: 
			set_limiting_allowance(type_conversion<bool>::to_number(v[LIMITING_ALLOWANCE]));
		case INVOICING:
			set_invoicing(type_conversion<bool>::to_number(v[INVOICING]));
		case NAME:
			set_name(v[NAME]);		
		case ID:
			set_id(type_conversion<int>::to_number(v[ID]));
			break;
		default: break;
	   }
		
		std::cout << "[activity_struct_csv.activity_struct_csv] " <<*this << std::endl;
}